﻿$(function(){
	alert(LabModel);
    var oContainerDefinition={
        'model':{type:LabModel},
        'dao':{type:LabDAO,args:[{ref:'model'}]},
        'service':{type:LabService,props:[{name:'dao',ref:'dao'}]},
        'application':{type:LabApplication,props:[{ref:'service'}]}
    };

    
    var _oContainer = new IContainer();
	
	//	Callback delegate for when context has loaded
	function onContextLoaded(oContext){
		//	Check each bean for a contextSupport Method
		function onEachBean(i,n){
			if(n.onContextSupport){
				//	If it has it call it
				n.onContextSupport();
			}
		}
		
		$.each(oContext.getBeans(),onEachBean);
	}
	
	//	Load the container definition
    _oContainer.load(oContainerDefinition,onContextLoaded);
});